mtd: nandsim: remove debugfs entries in error path
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Wed, 23 Aug 2017 07:03:04 +0000 (09:03 +0200)
committerBen Hutchings <ben@decadent.org.uk>
Tue, 19 Sep 2017 00:59:17 +0000 (01:59 +0100)
commit0c134b0a868bba456cc5386b3ac8cca56cc63c80
tree958043ea8914d643aa358a331c3f659f0483c01d
parent06d16589e238c080951a89b31b9c0995c5f10ed9
mtd: nandsim: remove debugfs entries in error path

The debugfs entries must be removed before an error is returned in the
probe function. Otherwise another try to load the module fails and when
the debugfs files are accessed without the module loaded, the kernel
still tries to call a function in that module.

Fixes: 5346c27c5fed ("mtd: nandsim: Introduce debugfs infrastructure")
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Richard Weinberger <richard@nod.at>
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name mtd-nandsim-remove-debugfs-entries-in-error-path.patch
drivers/mtd/nand/nandsim.c